package com.lau.eunms;

/**
 * @author:Lau
 * @create: 2022-12-13 10:54
 * @Description: 接口操作类型
 */

public enum OperateTypeEnum {

    LOG_IN(0, "登录"),

    QUERY(1, "查询"),

    ADD(2, "新增"),

    UPDATE(3, "更新"),

    DELETE(4, "删除"),

    LOG_OUT(5, "退出"),
    ;

    private Integer code;

    private String title;

    OperateTypeEnum(Integer code, String title) {
        this.code = code;
        this.title = title;
    }

    public Integer getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }

    public static OperateTypeEnum getByCode(Integer code) {
        for (OperateTypeEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}

